
#!/bin/bash

# 设置开始和结束日期
start_date="2024-10-31"
end_date="2025-02-31"

# 获取日期范围内的每一天
current_date=$start_date
while [ "$current_date" \< "$end_date" ]; do
    # 获取下一天的日期
    next_date=$(date -I -d "$current_date + 1 day")
    
    # 统计当前日期的代码提交行数
    git log --since="$current_date" --until="$next_date" --pretty=tformat: --numstat | awk '{add+=$1; subs+=$2; loc+=$1-$2} END {printf "%s: Added lines: %s, Removed lines: %s, Total lines: %s\n", "'$current_date'", add, subs, loc}'
    
    # 更新当前日期
    current_date=$next_date
done